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

Query time 0.00028