UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'srEcq9cUM4jwGNXaBZBkTXXDmLr79Z2J9dYRftwM1ro=' 
WHERE 
  key_id = 'bf6bab6abdfd9e9f0c8ecaa630f681203f17c5db53ab152288e3850b059e6ed2' 
  AND (
    token = 'srEcq9cUM4jwGNXaBZBkTXXDmLr79Z2J9dYRftwM1ro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023