UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ebc2degl/3acBIrx3uekIDmNi2aX5pAMtCMGHHPSvsY='
WHERE
key_id = 'a34e6a9b6cc6e91903f0a478ef754034f35faa9412dff56842362a81b01f9b24'
AND (
token = 'Ebc2degl/3acBIrx3uekIDmNi2aX5pAMtCMGHHPSvsY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)