UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Br0YMwHMoBKq0+RbIO/lVM2/YfKV7F3Vw6q5ogBXngg='
WHERE
key_id = 'bc3b77d5348a9f0cf52b054e739efcb7beaf8b94fc5f5b3ec6ba08ba242216f4'
AND (
token = 'Br0YMwHMoBKq0+RbIO/lVM2/YfKV7F3Vw6q5ogBXngg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)