UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EorcRinDmhgp3oAgRTl3Wpz/0GYMzrSYFpbsRiJQgdc=' 
WHERE 
  key_id = '168716a265b017b3592ed947efe777d9d9fc8c00065979f8e67b75453359f94e' 
  AND (
    token = 'EorcRinDmhgp3oAgRTl3Wpz/0GYMzrSYFpbsRiJQgdc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029