UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jq+Cz1MhRu3taxRwbYaqfO2BXHwCrn+cUIiVnAqUZCU='
WHERE
key_id = '0e70521acf93dbcc1177eea9203d76f2d20ffe5b0737a43717dc7e888cc90521'
AND (
token = 'Jq+Cz1MhRu3taxRwbYaqfO2BXHwCrn+cUIiVnAqUZCU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)