UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '32UEc+LBPgGd6A58ku78YR8EUfPdfU8L3RaUqpLD/Ew=' 
WHERE 
  key_id = 'a0b51ee4abc38af55c7c63888d24dae0d42bedf8aeeb142db264d72f21381897' 
  AND (
    token = '32UEc+LBPgGd6A58ku78YR8EUfPdfU8L3RaUqpLD/Ew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026