UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PP8xMSi2LWfJo05qRuQ/wOaEF8UZYwc7bh1t3DT/20g=' 
WHERE 
  key_id = '9c81dea7f0dc3fb4a98a013fc30b85acc382fd28bbc7bc8df0a925bd66150e1a' 
  AND (
    token = 'PP8xMSi2LWfJo05qRuQ/wOaEF8UZYwc7bh1t3DT/20g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022