UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd3r2eXLTvW2+vCW6bI4YzPPxe5wD82wd2+l28LHPXhA='
WHERE
key_id = '4b262ee3669a87064b87ae5d156ef6fb8b8d69649832a9f262d51415ba8ae599'
AND (
token = 'd3r2eXLTvW2+vCW6bI4YzPPxe5wD82wd2+l28LHPXhA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)