UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KbeZKugjYZ0Vu6lNTbmPJ9ZjTkZulED3Hj//nR+y3Cc=' 
WHERE 
  key_id = '230006d36699c4c8a53ad8b03ffed493ef86e98b6cd4f1308fed8f8d740fc1c7' 
  AND (
    token = 'KbeZKugjYZ0Vu6lNTbmPJ9ZjTkZulED3Hj//nR+y3Cc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00147