UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wcOI5I2HlGPJ0rrVwvSBvWUtBI0I+vRdCBPdHyO8aP0=' 
WHERE 
  key_id = 'd551f1a92688f118e47d16caf4bad9993ca53bc6137bbbca6e39224c15635508' 
  AND (
    token = 'wcOI5I2HlGPJ0rrVwvSBvWUtBI0I+vRdCBPdHyO8aP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031