UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/+1wiQ48eVHDVBFcTiUwkmOcoElN6Hl2vDEwK0BPhbM=' 
WHERE 
  key_id = 'f90187e9bc4a708493c30eced72f191c2843b088ecfd557822a23b678d54f3d0' 
  AND (
    token = '/+1wiQ48eVHDVBFcTiUwkmOcoElN6Hl2vDEwK0BPhbM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057