UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3KnhgVfrR3HjncLNE2MJzX1+Wjnxxf2r4z/8wMfo7qQ='
WHERE
key_id = 'b2a2d3f383c7831ed267ef8c1619251aa4a5c32c761a26ee5ba3ddf01591c131'
AND (
token = '3KnhgVfrR3HjncLNE2MJzX1+Wjnxxf2r4z/8wMfo7qQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)