UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lHkbnpjDAnJRwGff2R99cmsL+UsE2RwU2Do4Gudfvfs=' 
WHERE 
  key_id = '909af089af425e9977a25d057dd229023c4ec534d122b3eb377a2b22d3660a2c' 
  AND (
    token = 'lHkbnpjDAnJRwGff2R99cmsL+UsE2RwU2Do4Gudfvfs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025