UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fYS50wGluNQBlsfuEHJqVDuYaO+5sLhTUEue5XCKZSo='
WHERE
key_id = '2027e3336c13c1135e67b5af0afc01e006572f5e5964c8d47c532c89c47c046a'
AND (
token = 'fYS50wGluNQBlsfuEHJqVDuYaO+5sLhTUEue5XCKZSo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)