UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VY7PggGK6+4p2d3MrmcAzjheIyV1XkRj20fiSsTmaAE=' 
WHERE 
  key_id = 'fc62136ccde7fbc08fa273ec9db765156bbead901692292fe7a9e796cf2dfb10' 
  AND (
    token = 'VY7PggGK6+4p2d3MrmcAzjheIyV1XkRj20fiSsTmaAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00011