UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ft6EYBJzBc+cY1A7QBXOItyIYHyySLMyq6mTxFnwt5o=' 
WHERE 
  key_id = '835cc372b0000e7e6e9f735ece0bd73231f88665ec5c4a74e3538f81a42e6625' 
  AND (
    token = 'ft6EYBJzBc+cY1A7QBXOItyIYHyySLMyq6mTxFnwt5o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032