UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zZ2H4g/ZdaQX5NmBMRRrqNm7VnPlYQOiPAJOkh8VU0g='
WHERE
key_id = '04eb1fc95fbe165bf6ae7b573f9401bea84a20c74c96c49052224c614a84a93d'
AND (
token = 'zZ2H4g/ZdaQX5NmBMRRrqNm7VnPlYQOiPAJOkh8VU0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)