UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lfBqGQyf1ngIckwhRakH5mX4AoW9sNkFsqWuF1XJA44=' 
WHERE 
  key_id = '43a925b8be252a1399400d89c85cbcbdcba6af559fc9da2078a13556101b5e5c' 
  AND (
    token = 'lfBqGQyf1ngIckwhRakH5mX4AoW9sNkFsqWuF1XJA44=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034