UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mX97wGol5zc2jL/g3r2OCUoL4jMIrlzO+Gy0TsZ4EHk=' 
WHERE 
  key_id = '35f9fb0a9227c1930740c04c021a49092f3bbc293c98896392a7cfddf0e30cd1' 
  AND (
    token = 'mX97wGol5zc2jL/g3r2OCUoL4jMIrlzO+Gy0TsZ4EHk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025