UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4jwvEHlEsthyJD7auZ3XRp11tAtw/oDJMQ1ufKxByf4=' 
WHERE 
  key_id = '05ea041747d1b95b86cf29e13a7f2e64e76e7d423e360f97d1ecf8962f69503f' 
  AND (
    token = '4jwvEHlEsthyJD7auZ3XRp11tAtw/oDJMQ1ufKxByf4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029