UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v8l9BuGfYrh/m4DkQgu2zaBiQ4fdc5YWeHpkDqI+O34=' 
WHERE 
  key_id = 'c816a7e6909def658223889632cd23308da9552ad3fd01e2fae6b58a7669fb2d' 
  AND (
    token = 'v8l9BuGfYrh/m4DkQgu2zaBiQ4fdc5YWeHpkDqI+O34=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022