UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xzq84V3r/4eFXfLTPAJhrAvrmY/VjhrJyc4MAx21LZs=' 
WHERE 
  key_id = '73299826cef01e8b8595fdb41b776b97f747ced124384aca53c4471fa84d50e6' 
  AND (
    token = 'Xzq84V3r/4eFXfLTPAJhrAvrmY/VjhrJyc4MAx21LZs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033