UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q6wxycijg4F/x9mwQUZOoEE/SVCVopYmQWVGUI4Yj9M='
WHERE
key_id = '8dd7d044527f2e45ae1900054b87156a94a8deb8d20a90d85dc245c05a695b6b'
AND (
token = 'q6wxycijg4F/x9mwQUZOoEE/SVCVopYmQWVGUI4Yj9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)