UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4xJn45u4t1EIN1R7wST76DIaRoQmVMUuOI/2LB/hWV4='
WHERE
key_id = '7dee0ec546f17fb581473d5a8716ed67319277996d705102c7205ee9dcaf08a3'
AND (
token = '4xJn45u4t1EIN1R7wST76DIaRoQmVMUuOI/2LB/hWV4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)