UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ukFNca3Bb5jCSK9v6V2JUxdBPOiluwkMwn/7bS4/CtA=' 
WHERE 
  key_id = 'cbc9776b3d9c5db9dda5f68e0d3d4c5e8b43bb0f80eec39db3f9d30a2128cb9b' 
  AND (
    token = 'ukFNca3Bb5jCSK9v6V2JUxdBPOiluwkMwn/7bS4/CtA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051