UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+NM+shMdSGfvm8JfEMWhL1xBqO/0bnsCKivfukIJths='
WHERE
key_id = '138b54318dd4c52cbf994c7ecf36aed9847c7f90aae37e2ac8fbbbee70b7ad24'
AND (
token = '+NM+shMdSGfvm8JfEMWhL1xBqO/0bnsCKivfukIJths='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)