UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '96kKYYnKpIYYrushhZMBaAN/Sq81CaZgzxryST2De/o=' 
WHERE 
  key_id = '5827951336f1cd4defe476abeea01e4b01a4ac42248ef144357a07e1b2821513' 
  AND (
    token = '96kKYYnKpIYYrushhZMBaAN/Sq81CaZgzxryST2De/o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022