UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lojzwCaYCA2b9+wBJG7GaEw18En2HJX/jARbnZ8atqg='
WHERE
key_id = 'd26b13bedb765f18ac9a9c523775ee5e7ffe3450246db2406ec7f4d1ceb088bb'
AND (
token = 'lojzwCaYCA2b9+wBJG7GaEw18En2HJX/jARbnZ8atqg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)