UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'euVpCxeBxJYcH9XDRXnHKCa2dx48J8hNnyHSAq3npg8='
WHERE
key_id = 'dbd5a329ac115b8d6b13ff4a6d2ec556816b639874766a6b48475310d54f80da'
AND (
token = 'euVpCxeBxJYcH9XDRXnHKCa2dx48J8hNnyHSAq3npg8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)