UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/q/gbDoDxplBWM/wiUJBQOOmmwN1IHv+KJuNuwdmHfQ='
WHERE
key_id = 'c5f508a5f290e4e8d292814c159f4c7021bdb336f6e26a231001760c106c023a'
AND (
token = '/q/gbDoDxplBWM/wiUJBQOOmmwN1IHv+KJuNuwdmHfQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)