UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MDIQJz4G6awutJ5MEZPGQN51ClxB3Luz/FnU2o1P5+o=' 
WHERE 
  key_id = '13ce970a65a1d02103f5fb8d49d84ed19586d70c17d03f5fc9160e00ad0650e4' 
  AND (
    token = 'MDIQJz4G6awutJ5MEZPGQN51ClxB3Luz/FnU2o1P5+o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042