UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dJ0yVpL24RcepyAWC/3LPChLh2oAbAL6iUoeYl9Qww0=' 
WHERE 
  key_id = 'fbed2a4b167a492b5c79e8cb431acc889f16020da5c9bf592216c7d6e223aa62' 
  AND (
    token = 'dJ0yVpL24RcepyAWC/3LPChLh2oAbAL6iUoeYl9Qww0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032