UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '30PHrp9Ds1XdmE+hqcZgT917R23KBCPNCG3b2bZEB6M=' 
WHERE 
  key_id = '2385549ff1099bb88e0cc3b3ea09831a6118f7814f220e6dceb21ae881454cd4' 
  AND (
    token = '30PHrp9Ds1XdmE+hqcZgT917R23KBCPNCG3b2bZEB6M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046