UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VOsRs2rDa1f8EuvV1XVnOgrla7sROt3kZ4wj/V71UW4='
WHERE
key_id = 'f35f9f33015398aea00639e908f3b770bc3448819d8c94b0e944095247c600fa'
AND (
token = 'VOsRs2rDa1f8EuvV1XVnOgrla7sROt3kZ4wj/V71UW4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)