UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HE/kQMW69GoMpeMhcNAXEvf3KtS1nuJIst/Cz6Ezx2I='
WHERE
key_id = '2bc5cd707238823bc55b1974ab39985941e3871f7e5bb6ab07f049531e5fab79'
AND (
token = 'HE/kQMW69GoMpeMhcNAXEvf3KtS1nuJIst/Cz6Ezx2I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)