UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vb4Y+mT3VYBKm4VsFnnWVQuS1WTGAlTGoLynFziw1eQ='
WHERE
key_id = 'c4b2f3eefe8f60eccc6ec553ae345097981cb6f83bc939755f9c9ba61c08814a'
AND (
token = 'vb4Y+mT3VYBKm4VsFnnWVQuS1WTGAlTGoLynFziw1eQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)