UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XatiXrscBa/fNePwAWo2OmHoCN/rm0s6ZU7Md3KTC+c=' 
WHERE 
  key_id = '285249fb44a6accd45bb866faf0a3e82dd0aee7357f96b1d1398adb23914ff9c' 
  AND (
    token = 'XatiXrscBa/fNePwAWo2OmHoCN/rm0s6ZU7Md3KTC+c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033