UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RfPQMZM0N7VsKcVmHrU6umJ7tHCn+HU5x+8EDF6dKhs='
WHERE
key_id = '15505a69532b31c7a49404bf8654bfe0bd90fdf8c84a844788b70b2df93e4a53'
AND (
token = 'RfPQMZM0N7VsKcVmHrU6umJ7tHCn+HU5x+8EDF6dKhs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)