UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gKlg9E/mvfjnXrxS6IS4wJQxXuCze6IdkH7LASRjMO0='
WHERE
key_id = 'a81f3bbd827e7d3e26b51729eb6b480f4369a02d26661340818ba29c10a7cbb6'
AND (
token = 'gKlg9E/mvfjnXrxS6IS4wJQxXuCze6IdkH7LASRjMO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)