UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ESSyc0gRFwZ6/eMV/Mwp4ERgCRMiko6pg4VIRikP9C4=' 
WHERE 
  key_id = 'f25b5295b3565710fa26b435967891632da9b1c625add3146f9528f5d68bfb4d' 
  AND (
    token = 'ESSyc0gRFwZ6/eMV/Mwp4ERgCRMiko6pg4VIRikP9C4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050